using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;namespace fileinfo_文件属性读取{ class Program { static void Main(string[] args) { string path = @"F:\C#练习test\文件处理-存储\ConsoleApplication1\document3.txt"; FileInfo fileInfo = new FileInfo(path); if (fileInfo.Exists==true) { //fileInfo.Delete(); Console.WriteLine(fileInfo.CreationTime); Console.WriteLine(fileInfo.FullName); Console.WriteLine(fileInfo.Length); Console.WriteLine(fileInfo.Attributes); } Console.ReadLine(); } }}
评论